#include <render\threads\threadBase.h>

threadBase::threadBase() {
  m_stoprequested = false;
}

threadBase::~threadBase() {

}

void 
threadBase::start() {
  assert(!m_thread);
  m_thread = boost::shared_ptr<boost::thread>(new boost::thread(boost::bind(&threadBase::run, this)));
}

void 
threadBase::stop() {
  assert(m_thread);
  m_stoprequested = true;
  m_thread->join();
}

void 
threadBase::run() {
  int iteration = 0;
  while (!m_stoprequested) {
    
    boost::mutex::scoped_lock l(m_mutex);
    
    boost::this_thread::sleep(boost::posix_time::milliseconds(10));
  }
}  
